<template>
  <div class="header">
    <el-menu
        :default-active="$route.path"
        class="el-menu-demo"
        mode="horizontal"
        @select="handleSelect"
        background-color="#1aad19"
        text-color="#fff"
        active-text-color="#ffd04b"
        router
    >
      <el-menu-item index="/home_page" route>home</el-menu-item>
      <el-menu-item index="/write" route>write</el-menu-item>
      <el-menu-item index="/wallet" route>wallet</el-menu-item>
      <el-menu-item index="/about" route>about</el-menu-item>
    </el-menu>
    <el-main>
      <router-view></router-view>
    </el-main>
  </div>
</template>

<script>
export default {
  name:"home_header",
  data() {
    return {
      activeIndex: '1',
      activeIndex2: '1'
    };
  },
  methods: {
    handleSelect(key, keyPath) {
      console.log(key, keyPath);
    }
  }
}
</script>